package com.qf.homeworkssm.aspcat;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyAspact {


    @Pointcut("execution(* com.qf.homeworkssm.controller..*.*(..))")
    public void mypointcut() {


    }

    @Before("mypointcut()")
    public void before(){
        System.out.println("+++++++++++++++");
    }

    @Around("mypointcut()")
    public Object around(ProceedingJoinPoint pjp) throws Throwable {

        System.out.println("=====前置=========");

        Object proceed = pjp.proceed();

        System.out.println("========后置======");

        return proceed;

    }

    @After("mypointcut()")
    public void after(){
        System.out.println("=-=====后置=======");
    }


}
